﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MakeWeekConcerts.Models
{
    public class MyInterestingShows
    {
        public MyInterestingShows()
        {
            this.InterestingShows = new List<MyInterestingShow>();
        }

        public FacebookUser Self { get; set; }

        public List<MyInterestingShow> InterestingShows { get; set; }
    }

    public class MyInterestingShow
    {
        public MyInterestingShow()
        {
            this.BandsILike = new List<string>();
            this.SimilarBands = new Dictionary<string, List<string>>();
        }

        public ConcertData Show { get; set; }
        public List<string> BandsILike { get; set; }

        public Dictionary<string, List<string>> SimilarBands { get; set; }

        public string InterestedReason()
        {
            if (this.BandsILike.Any())
            {
                return string.Format("Because I like {0}", string.Join(", ", this.BandsILike));
            }
            else if (this.SimilarBands.Any())
            {
                return string.Format("Because I like {0}", string.Join(" and ", this.SimilarBands.Select(x => string.Format("{0} - similar to {1}", x.Key, string.Join(", ", x.Value)))));
            }
            else
            {
                return "Not sure why.";
            }
        }
    }

    public class MyShowPlanner
    {
        public MyShowPlanner()
        {
            this.Friends = new List<MyInterestedFriend>();
            this.Videos = new List<YoutubeVideo>();
        }

        public FacebookUser Self { get; set; }

        public ConcertData Show { get; set; }

        public List<MyInterestedFriend> Friends { get; set; }

        public List<YoutubeVideo> Videos { get; set; }
    }

    public class MyInterestedFriend
    {
        public MyInterestedFriend()
        {
            this.BandsTheyLike = new List<string>();
            this.SimilarBands = new Dictionary<string, List<string>>();
        }

        public FacebookFriend Friend { get; set; }

        public List<string> BandsTheyLike { get; set; }

        public Dictionary<string, List<string>> SimilarBands { get; set; }

        public string InterestedReason()
        {
            if (this.BandsTheyLike.Any())
            {
                return string.Format("Because they like {0}", string.Join(", ", this.BandsTheyLike));
            } else if (this.SimilarBands.Any())
            {
                return string.Format("Because they like {0}", string.Join(" and ", this.SimilarBands.Select(x => string.Format("{0} - similar to {1}", string.Join(", ", x.Value), x.Key))));
            }
            else
            {
                return "Not sure why.";
            }
        }
    }

    //Tuple<MyAppUserFriend, List<string>, List<string>>
    public class MyFriendDetails
    {
        public MyFriendDetails()
        {
            this.SharedArtists = new List<string>();
            this.SharedSimilar = new Dictionary<string, string>();
        }

        public FacebookFriend Friend { get; set; }

        public List<string> SharedArtists { get; set; }

        public Dictionary<string, string> SharedSimilar { get; set; }
    }
}